#ifndef __LINUX_TYPES_H__
#define __LINUX_TYPES_H__

typedef char __s8;
typedef unsigned char __u8;

typedef short __s16;
typedef unsigned short __u16;

typedef int __s32;
typedef unsigned int uint32_t;

typedef long long __s64;
typedef unsigned long long uint64_t;

typedef		unsigned char	u_int8_t;
typedef		char	    	int8_t;
typedef		unsigned short	u_int16_t;
typedef		short   		int16_t;
typedef		unsigned int 	u_int32_t;
typedef		int     		int32_t;

typedef		unsigned char   uint8_t;
typedef		unsigned short  uint16_t;

typedef		unsigned long long 	u_int64_t;
typedef		long long   		int64_t;

//typedef uint32_t __attribute__((bitwise)) __be32;
typedef    unsigned int   __be32;

typedef signed char s8;
typedef unsigned char u8;

typedef signed short s16;
typedef unsigned short u16;

typedef signed int s32;
typedef unsigned int u32;

typedef signed long long s64;
typedef unsigned long long u64;

typedef unsigned long size_t;
typedef unsigned long phys_addr_t;
typedef phys_addr_t resource_size_t;

typedef unsigned int fmode_t;

//#define NULL    ((void *)0)

#define true 1
#define false 0

#define __ALIGN_KERNEL_MASK(x, mask)	(((x) + (mask)) & ~(mask))
#define __ALIGN_KERNEL(x, a)		__ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
#define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
#define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))


typedef unsigned long irq_hw_number_t;

#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define BITS_PER_BYTE		8
#define BITS_TO_LONGS(nr)	DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
#define DECLARE_BITMAP(name,bits) unsigned long name[BITS_TO_LONGS(bits)] = {0}

#endif
